﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Sharp.Domain.Model;
using Sharp.Infrastructure;

namespace Sharp.Domain.CMSBoundedContext.VIUModule.Aggregates
{
    public partial class Tag : AggregateRoot, IStandardEntity, IStandardState
    {
        public Tag()
        {
            VIUs = new List<VIU>();
        }

        [Index]
        public string Name { get; set; }
        public long? Counts { get; set; }
        public long? ViewCounts { get; set; }
        /// <summary>
        /// 首字母
        /// </summary>
        [StringLength(1)]
        public string Initial { get; set; }

        [Association("VIUs", "Id", "")]
        public virtual ICollection<VIU> VIUs { get; set; }
        public Guid? CategoryId { get; set; }


        [Association("VIUCategories", "Id","")]//这个attribute主要用在批量导入数据时候,不把他当做导入的列
        [ForeignKey("CategoryId")]
        public VIUCategory Category { get; set; }

        public DateTime? CheckInTime { get; set; }
        public Guid? CheckInUserId { get; set; }
        public DateTime? ModifiTime { get; set; }
        public Guid? ModifiedUserId { get; set; }
        [Index]
        public EntityStateOperate EntityState { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 是否已处理
        /// </summary>
        public bool IsHandled { get; set; }
    }
}